<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use m\assets\AppAsset;
use common\widgets\Alert;

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalale=no" name="viewport">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->params['page']['page_title']) ?></title>
    <?= $this->registerMetaTag(['name' => 'keywords', 'content' => $this->params['page']['page_keywords']]) ?>
    <?= $this->registerMetaTag(['name' => 'description', 'content' => $this->params['page']['page_description']]) ?>

  <link rel="stylesheet" href="http://static.tianpinwang.com.cn/v1/mobile/css/weui.min.css">
  <link rel="stylesheet" href="http://static.tianpinwang.com.cn/v1/mobile/css/jquery-weui.min.css">
  <link rel="stylesheet" href="http://static.tianpinwang.com.cn/v1/mobile/fonts/iconfont.css">
  <link rel="stylesheet" href="http://static.tianpinwang.com.cn/v1/mobile/css/local.css">

  <script src="http://static.tianpinwang.com.cn/v1/mobile/js/jquery-2.1.4.js"></script>
  <script src="http://static.tianpinwang.com.cn/v1/mobile/js/jquery-weui.min.js"></script>
  <script src="http://static.tianpinwang.com.cn/v1/mobile/js/swiper.js"></script>
  <script src="http://static.tianpinwang.com.cn/v1/mobile/js/global.js"></script>

    <?php $this->head() ?>
    <?= $this->params['w_config']['statistics_code'] //统计代码?>
    
</head>
<body>
<?php $this->beginBody() ?>

    <?= $content ?>

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"> </script>
<script>
  wx.config({
      debug: false,
      appId: 'wx2bc3e1648beb8caa', // 必填，公众号的唯一标识
      timestamp: 1445405452, // 必填，生成签名的时间戳，切记时间戳是整数型，别加引号
      nonceStr: 'SzlrgiRHej8dKCN2', // 必填，生成签名的随机串
      signature: 'b2051ca373cb835063e423a4d1455764c9cd4312', // 必填，签名，见附录1
      jsApiList: [
        'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'hideMenuItems',
        'showMenuItems',
        'hideAllNonBaseMenuItem',
        'showAllNonBaseMenuItem',
        'translateVoice',
        'startRecord',
        'stopRecord',
        'onRecordEnd',
        'playVoice',
        'pauseVoice',
        'stopVoice',
        'uploadVoice',
        'downloadVoice',
        'chooseImage',
        'previewImage',
        'uploadImage',
        'downloadImage',
        'getNetworkType',
        'openLocation',
        'getLocation',
        'hideOptionMenu',
        'showOptionMenu',
        'closeWindow',
        'scanQRCode',
        'chooseWXPay',
        'openProductSpecificView',
        'addCard',
        'chooseCard',
        'openCard'
      ]
  });

wx.ready(function(){
  var shareconfig = { //分享到朋友圈
    title: <?= '"'.Html::encode($this->params['page']['page_title']).'"' ?>, // 分享标题
    desc: '添品网是国内首家专业的食品添加剂、食品配料和食品调味料自营电商平台。',
      link: <?='"'.Yii::$app->request->getHostInfo().Yii::$app->request->url.'"'?>, // 分享链接
      imgUrl: 'http://static.tianpinwang.com.cn/v1/images/logo.png', // 分享图标
      success: function (res) {
      },

      cancel: function () {
      }
  }

  wx.onMenuShareTimeline(shareconfig);  //朋友圈

  wx.onMenuShareAppMessage(shareconfig); //分享给朋友

});

</script>
<script type="text/javascript">
  function checkform(){
    var pro_name = $('#search_input').val();
    if(pro_name){
      return true;
    }else{
      alert('请输入您要搜索的商品名称');
      return false;
    }
  }
  $(function(){
    //全局搜索
    $('.searchBtn').on('click',function(){
      if(checkform()){
        $('form').submit();
      }
    });
  })
</script>